# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-flask-whooshalchemy-redux
pkgname=('python2-flask-whooshalchemy-redux' 'python-flask-whooshalchemy-redux')
_pkgname=Flask-WhooshAlchemy-Redux
pkgver=0.7.1
pkgrel=10
pkgdesc='Whoosh extension to Flask/SQLAlchemy.'
arch=('any')
url='https://pypi.python.org/pypi/Flask-WhooshAlchemy-Redux/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/33/46/f8183109c5b4be9f96d4c0a382bc296ff9ab6c78d68808e1ef1aa97a9686/$_pkgname-$pkgver.tar.gz")
sha512sums=('1a3cac5ccab861755b076b232ad6ed9791b32e92de2cf464fad580c955e6921fea44cfc1ff58cde32f4606835bd50dbb85d5ea9efffc32ef9f5ddfa92aeb0cf6')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-flask-whooshalchemy-redux() {
  depends=('python2-flask' 'python2-flask-sqlalchemy' 'python2-blinker'
           'python2-whoosh')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-flask-whooshalchemy-redux() {
  depends=('python-flask' 'python-flask-sqlalchemy' 'python-blinker'
           'python-whoosh')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

